1. Field
The present invention relates to a file system using a flash memory and a data management system for the file system.
2. Description of the Related Art
With increasing storage capacities of individual flash memories, consumer equipment and industrial equipment that use built-in or connected file systems using flash memories as main storages are increasingly used. Of such file systems, FAT file systems having the so-called “FAT (file allocation table)” are often used as file systems used for equipment (e.g., personal computers) that handles data for each file.
The term “FAT” refers to a file management table provided in a memory area in a flash memory in order to improve the management efficiency during management of data as a file. When a file is regarded as a group of data, i.e., as being constituted by clusters, the FAT can also be referred to as a “cluster management table”.
The FAT file system is a file system that has, in the memory area, a file storage area and a file management table and that manages the use states of clusters.
When “0” is written in an area in the file management table, this means that a cluster corresponding to the area is not in use, and when a numeral other than “0” is written, this means that a corresponding cluster is in use. The FAT file system manages a file in accordance with the use states of the clusters.
With this arrangement, when a cluster in the file storage area is changed from a non-use state to a use state, it is necessary to change any of bits in areas in the file management table to “1”.
On the other hand, in the flash memory, a state in which “1” is written indicates an erasure state (In other words, only erasure changes to “1”), and is changed to “0” upon written of data.
With this arrangement, when the in-use state (the state in which “0” is written to any of the table area) is changed to the non-use state (the state in which all bits in the table area are “1”), the flash memory needs to perform a data erasure operation.
Erasure in the flash memory is performed for each unit having a certain size, and a cluster use-state-indicating area in the file management table is smaller than the area of erasure unit. Thus, the erasure unit includes multiple use-state-indicating areas.
Thus, in order to write the use state of a new cluster to in the file management table area, it is necessary to save data in the file management table area, perform erasure to temporarily change all bits to “1, additionally write the use state of the new cluster to the saved file management area data, and then write back the data.
If one use-state-indicating area is provided for each erasure unit in order to reduce the number of data erasures, the area occupied by the file management table, the area being located in the flash memory, increases, and thus the use efficiency declines.
If, however, multiple use-state-indicating areas are provided for each erasure unit, erasure and writing are repeated every time data is modified. This means that the erasure operation and the writing operation concentrate on a particular erasure unit. As a result, the erasure unit deteriorates faster than other portions.
When a large number of portions with “0” exist in bits that constitute data, it is proposed to write, to the flash memory, data by inverting the logic of bits that constitute the data. This arrangement can delay deterioration for each erasure (e.g., refer to Japanese Laid-open Patent Publication Nos. 2005-157781 and 11-25002).
When the logic of bits that constitute data is inverted and the resulting data is written to the flash memory, the number of writing operations decreases. However, the number of erasures does not decrease.